﻿@if (Request.IsAuthenticated)
{
    <ul class="nav navbar-nav navbar-right">
        <li><span style="display:block;margin-top:10px;">@Html.Raw("Hi " + User.Identity.Name + ",")</span></li>
        @if (User.Identity.Name == "admin")
        {
            <li>@Html.ActionLink("版块管理", "index", "sectionadmin", routeValues: null, htmlAttributes: null)</li>
        }
        <li>
            @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "logoffForm" }))
            {
                @Html.AntiForgeryToken()
                <a href="javascript:document.getElementById('logoutForm').submit()">注销</a>
            }
        </li>
    </ul>
}
else
{
    <ul class="nav navbar-nav navbar-right">
        <li>@Html.ActionLink("注册", "register", "account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
        <li>@Html.ActionLink("登录", "login", "account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
    </ul>
}